POV-Ray : Newsgroups : povray.newusers : Width of character : Re: Width of character Server Time
5 Sep 2024 12:23:33 EDT (-0400)
  Re: Width of character  
From: Christoph Hormann
Date: 19 Nov 2000 06:27:48
Message: <3A17B933.82F38498@schunter.etc.tu-bs.de>
Jessica Bushnaq wrote:
> 
> Hello, (hope I do this right, first time try to write to a newsgroup)

Welcome to these groups, the posting looks ok to me, some general
information about things here can be found in: 

povray.announce.frequently-asked-questions

> I try to make a text in a povray picture, putting together characters in
> different textures.( with the text object and a truetype fond)
> I have problems setting the distance between the characters right, because I
> do not know the exact width of the characters.
> Have I to do this by try and error, translate the characters until it looks
> right or can somebody think of another method to do this ?
> Especially: Is there a method to get the exact width of a given character?
> 
> Jessica Bushnaq

IIRC there is no method in Povray to find out the width of the single
characters. Some things you could do anyway:

- The character width is stored somewhere in the TTF file, you could try
to read it with an external program and put a table with the data of all
character in a pov-file

- You could use a non proportial font (like Courier), where all the
characters have the same width.

- you could try to find the gaps between the characters with megapov's
trace function and use a gradient pattern to give the different characters
different textures.  This probably sounds quite complicated and it
requires some (pov-)programming knowledge, but IMO this is the most
elegant way :-)

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.